<template>
	<view class="content">
		<!-- 电量显示栏-->
		<view class="top_nav">
		<view class="kong"></view>
			<view class="tab_item">
				<view class="return" @click="returnPage">
					<image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/course/jiantou.png"></image>
				</view>
				<view class="title">行业资讯</view>
				<view class="return"></view>
			</view>
		</view>
		
		<view class="information_content">
			<view class="content_item_zixun" v-for="(item, index) in archives" :key="index" @click="toZixunDetail(item)">
				<view class="content_left_zixun">
					<view class="content_title">{{ item.title }}</view>
					<view class="content_box">{{item.subtitle}}</view>
					<view class="content_bottom">
						<view class="bottom_left"></view>
						<view class="bottom_right">{{ item.createtime }}</view>
					</view>
				</view>
				<view class="content_right_zixun"><image :src="Config_ysy.cosurl + item.a_image" mode="scaleToFill"></image></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				archives:[],
				token:''
			}
		},
		onLoad(options) {
			this.token=options.token
			var url = '/api/home/index/archivesList';
			let params= {
				token:this.token
			};
			
			this.Unfold_data.upload_data(params, 'GET', url, res => {
				// console.log(res)
				if (res.statusCode == 200 && res.data.code == 1) {
					this.archives = res.data.data;
				}
			});
		},
		methods: {
			returnPage(){
				uni.navigateBack({
					delta:1
				})
			},
			loadData(source) {
				if(source==0&&this.screening[this.currentIndex].loaded){
					return;
				}
				if(source==1&&this.screening[this.currentIndex].loadingType!="more"){
					return;
				}
			},
			// 跳转资讯详情
			toZixunDetail(item){
				uni.navigateTo({
					url:'/pages/zixunDetail/zixunDetail?id=' + item.id+'&token='+this.token
				})
			},
		}
	}
</script>

<style lang="scss">
.content{
	width: 100%;
	height: 100%;
	background: #000000;
	position: relative;
	.top_nav{
		width: 100%;
		height: 160upx;
		background-image: url('https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/buy/1.png');
		background-size: cover;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 10;
		.kong{
			width: 100%;
			height: 60upx;
		}
		.tab_item{
			width: 90%;
			margin: 0 auto;
			height: 100upx;
			display: flex;
			align-items: center;
			justify-content: center;
			.return{
				flex: 1;
				width: 100%;
				image{
					width: 29upx;
					height: 29upx;
				}
			}
			.title{
				flex: 8;
				width: 100%;
				color: #ffffff;
				display: flex;
				align-items: center;
				justify-content: center;
				z-index: 10;
			}
		}
	}
	.information_content {
			width: 93.3%;
			margin: 0 auto;
			padding-top: 180upx;
			.content_item_zixun {
				width: 100%;
				padding: 20upx;
				background-color: #363636;
				margin-top: 20upx;
				border-radius: 30upx;
				display: flex;
				align-items: center;
				.content_left_zixun {
					flex: 5;
					display: flex;
					flex-direction: column;
					justify-content: space-around;
					.content_title {
						width: 90%;
						color: #af8e63;
						display: -webkit-box;
						-webkit-box-orient: vertical;
						-webkit-line-clamp: 1;
						overflow: hidden;
					}
					.content_box {
						width: 100%;
						height: 70upx;
						font-size: 26upx;
						color: #FFFFFF;
						background: #363636;
						display: -webkit-box;
						-webkit-box-orient: vertical;
						-webkit-line-clamp: 2;
						overflow: hidden;
						.rich-text{
							font-size: 26upx;
							color: #FFFFFF;
						}
					}
					.content_bottom {
						display: flex;
						justify-content:flex-end;
						color: #d5c9bb;
						font-size: 20upx;
						.bottom_right{
							padding-right:30upx;
						}
					}
				}
				.content_right_zixun {
					flex: 2;
					display: flex;
					flex-direction: row;
					justify-content: center;
					align-items: center;
					image {
						border-radius: 20upx;
						overflow: hidden;
						width: 180upx;
						height: 140upx;
					}
				}
			}
		}
}
</style>
